ESP32 Temperature and Humidity Meter with Real-Time Display

Are you looking for an easy project to monitor environmental conditions in real-time? This project will show you how to create an ESP32 Temperature and Humidity Meter whose readings will be received in real-time. This small, inexpensive project requires the ESP32 microcontroller, CHT8305 temperature and humidity sensor, a 20×4 I2C LCD display, and a DS3231 Real-Time Clock (RTC) module.

The system toggles: it will present the current temperature, humidity, date, and time for 10 seconds and then show the maximum and minimum values of the temperature and humidity for 5 seconds. In this article, we’ll walk you through every step—from selecting the components to putting the circuit together—making it great for home automation, tracking conditions in agriculture, or even as a learning project.

For more details on related projects, check out these guides:

  1. Build a Temperature, Humidity, and Dew Point Data Logger with ESP32
  2. Interfacing the CHT8305 Sensor with ESP32: Real-Time Temperature and Humidity Display
  3. How to Set Up a Real-Time Clock (RTC) with ESP32 and DS3231 Using NTP Time Synchronization

Components Required

  • ESP32 Development Board: A versatile microcontroller with built-in Wi-Fi and Bluetooth, ideal for IoT projects.
  • CHT8305 Sensor: A precise temperature and humidity sensor.
  • 20×4 I2C LCD Display: A 20-character by 4-line display to show the sensor data.
  • DS3231 RTC Module: A high-accuracy real-time clock to keep track of date and time, even when the device is powered off.
  • Jumper Wires (if needed): These are used to make connections between the components.
  • Breadboard or PCB (if needed): For assembling the circuit.

Overview | ESP32 Temperature and Humidity Meter

The ESP32 Temperature and Humidity Meter with Real-Time Display is designed to monitor environmental conditions in two modes:

  1. Real-Time Mode: Displays the current date, time, temperature, and humidity on the LCD for 10 seconds.
  2. High/Low Mode: Displays the highest and lowest recorded temperature and humidity values over the day for 5 seconds.

The cycling between modes makes the device ideal for continuous monitoring in environments-such as greenhouses, laboratories, or even at home-where tracking fluctuations in temperature and humidity is essential.

Building the Circuit ESP32 Temperature and Humidity Meter

To build this project, you’ll need to connect all the components using the I2C protocol, that allows multiple devices to communicate over two pins (SDA and SCL).

ESP32 Temperature and Humidity Meter Circuit

Steps to Assemble the Circuit:

  • ESP32 to CHT8305: Connect the SDA and SCL pins of the CHT8305 sensor to GPIO21 and GPIO22 on the ESP32.
  • ESP32 to RTC Module: Connect the DS3231 RTC module to the same I2C bus (GPIO21 for SDA and GPIO22 for SCL).
  • ESP32 to 20×4 LCD Display: The I2C LCD also connects to GPIO21 (SDA) and GPIO22 (SCL), sharing the I2C bus.

Using the I2C protocol can reduce the wiring complexity and free up other GPIO pins on the ESP32 for future expansion.

Functionality of the Meter

  1. Displaying Date, Time, Temperature, and Humidity: The DS3231 RTC module provides the current date and time, while the CHT8305 sensor measures the ambient temperature and humidity. These values are displayed on the LCD for 10 seconds. The first two lines show the date and time, and the last two show the current temperature and humidity.
  2. High/Low Tracking: The meter constantly checks the temperature and humidity throughout the day for the highest and lowest values. After displaying the current conditions, the meter automatically toggles to display the day’s high and low readings for 5 seconds.
  3. Alternating Display: The meter toggles between the current reading display and the high/low display at fixed intervals. This helps you monitor both the current conditions and the highest and lowest temperature and humidity levels of the day.

Advantages of Using the ESP32 and I2C Protocol

  • ESP32’s Versatility: The ESP32 is a powerful microcontroller with Wi-Fi and Bluetooth connectivity, perfect for IoT applications. Future enhancements include remote data monitoring or cloud integration.
  • Efficient I2C Communication: The I2C protocol enables efficient communication between multiple devices, such as a sensor, RTC, and LCD over the same two wires, hence simplifying hardware design by reducing wiring complexity.
  • Accurate Timekeeping: DS3231 RTC module provides high accuracy and thus can keep pace with time in case of system power off. This will ensure that the data is accurately timestamped.

temperature and humidity meter

Figure 2: Temperature and Humidity Meter Prototype

Applications of ESP32 Temperature and Humidity Meter

The following are different practical scenarios where an ESP32-based temperature and humidity meter will be helpful to:

  • Greenhouses and Farms: Economized water consumption due to monitored environmental conditions promotes efficient plant development.
  • More innovative Home Automation: Connect the meter to a smart home to keep and monitor indoor air quality.
  • Data logging for research: They can be used to track various environmental changes in scientific research studies by collecting accurate and timestamped data.

Maximum and Minimum of temperature and humidity meter

Figure 3: Alternating Display for High and Low Value

The ESP32 Temperature and Humidity Meter with Real-Time Display is an easy and functional project for real-time environmental monitoring. Such a meter would track the high and low daily readings and thus provide full data for anyone looking to monitor and improve environmental control.

This project can easily scale up with the addition of more features, such as data logging, wireless communication, or even environment-based automation, all enabled by the ESP32 and I2C communication.

Ideally, This project suits the DIY enthusiast, hobbyist, or anyone genuinely interested in IoT, home automation, and environmental monitoring.

Leave a Comment